﻿using System;

/*
 *  author: able
 *  @2012/2/20 17:39:25
 * 
 */
namespace __ts.Core.Api
{
    /// <summary>
    /// 
    /// </summary>
    public interface IoFutureListener<T>
    {
        /**
         * Called if there was an exception by the task as it was executing.
         * Expect {@link java.util.concurrent.CancellationException} of the
         * future was canceled or {@link java.util.concurrent.ExecutionException}
         * if there was an error executing the task the future was waiting on.
         *
         * @param t an instance of {@link Throwable}
         */
        void exception(Exception t);

        /**
         * Called when the task has completed.  This method provides the result
         * returned by the task.
         *
         * @param result the result returned by the task.
         */
        void completed(T result);
    }
}